package com.example.interview.no0101.solution;

import com.example.interview.no0101.Solution;

import java.util.HashSet;
import java.util.Set;

/**
 * @Description 解答-判定字符是否唯一
 * @ClassName SolutionImpl
 * @Author Administrator
 * @Date 2020/5/20 10:26
 * @Version 1.0.0
 */
public class ReplaceSolutionImpl implements Solution {

    @Override
    public boolean isUnique(String str) {
        for (int i=0; i<str.length(); i++){
            String s = str;
            s = s.replace(String.valueOf(s.charAt(i)),"");
            if (s.length() != str.length()-1){
                return false;
            }
        }
        return true;
    }
}
